<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html>
<head>
    <base href="${pageContext.request.contextPath}/">
    <title>Title</title>
    <link rel="stylesheet" href="bootstrap/css/bootstrap.min.css">
    <script type="text/javascript" src="js/jquery-3.3.1.min.js"></script>
    <script type="text/javascript" src="bootstrap/js/bootstrap.min.js"></script>
</head>
<body>
    <!--=======================路径导航=========================-->
    <ol class="breadcrumb">
        <li>主页</li>
        <li>员工管理</li>
        <li class="active">员工修改</li>
    </ol>
    <!--=======================路径导航.end=========================-->
    <!--=======================新增表单=========================-->
    <div class="panel-body" style="text-align: center;">
        <h2>员工修改</h2>
        <form action="emp/update" method="post" style="width: 350px;margin: 0 auto;">
            <input type="hidden" name="empno" value="${emp.empno}">
            <div class="form-group">
                <div class="input-group">
                    <div class="input-group-addon">员工姓名</div>
                    <input type="text" name="ename" class="form-control" value="${emp.ename}">
                </div>
            </div>
            <div class="form-group">
                <div class="input-group">
                    <div class="input-group-addon">部&emsp;&emsp;门</div>
                    <select name="dept.deptno" class="form-control">
                        <c:forEach items="${deptList}" var="dept">
                            <option value="${dept.deptno}" <c:if test="${dept.deptno==emp.dept.deptno}">selected</c:if>>${dept.dname}</option>
                        </c:forEach>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <div class="input-group">
                    <div class="input-group-addon">员工岗位</div>
                    <input type="text" name="job" class="form-control" value="${emp.job}">
                </div>
            </div>
            <div class="form-group">
                <div class="input-group">
                    <div class="input-group-addon">管&ensp;理&ensp;者</div>
                    <input type="text" name="mgr" class="form-control" value="${emp.mgr}">
                </div>
            </div>
            <div class="form-group">
                <div class="input-group">
                    <div class="input-group-addon">入职日期</div>
                    <input type="date" name="hiredate" class="form-control" value="<fmt:formatDate value="${emp.hiredate}" pattern="yyyy-MM-dd"/>">
                </div>
            </div>
            <div class="form-group">
                <div class="input-group">
                    <div class="input-group-addon">薪&emsp;&emsp;资</div>
                    <input type="text" name="sal" class="form-control" value="${emp.sal}">
                </div>
            </div>
            <div class="form-group">
                <div class="input-group">
                    <div class="input-group-addon">奖&emsp;&emsp;金</div>
                    <input type="text" name="comm" class="form-control" value="${emp.comm}">
                </div>
            </div>
            <div class="form-group" style="text-align: right;">
                <button type="submit" class="btn btn-primary">确定</button>
                <a href="emp/list" class="btn btn-default">取消</a>
            </div>
        </form>
    </div>
    <!--=======================新增表单.end=========================-->

</body>
</html>
